package org.zcl.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.zcl.service.SeckillProductsService;
import org.zcl.service.StockCallback;

/**
 * .
 *
 * @author zhuchenglin
 * @since 2024/6/18 16:33
 */
@Slf4j
@Service
public class StockCallbackImpl implements StockCallback {

    @Autowired
    private SeckillProductsService seckillProductsService;


    @Override
    public int getStockByDB(Long productId) {
        return seckillProductsService.getById(productId).getStock();
    }
}
